Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

afc/ward decomposition for embedded HVDC #64

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

alefcastelli
Copy link
Contributor

Thanks for opening a PR to PowerNetworkMatrices.jl, please take note of the following when making a PR:

Check the contributor guidelines

Comment on lines +29 to +30
ybus::Ybus{Tuple{Vector{Int64}, Vector{Int64}}, Tuple{Dict{Int64, Int64}, Dict{Int64, Int64}}},
study_buses::Vector{Int64}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
ybus::Ybus{Tuple{Vector{Int64}, Vector{Int64}}, Tuple{Dict{Int64, Int64}, Dict{Int64, Int64}}},
study_buses::Vector{Int64}
ybus::Ybus{
Tuple{Vector{Int64}, Vector{Int64}},
Tuple{Dict{Int64, Int64}, Dict{Int64, Int64}},
},
study_buses::Vector{Int64},

Comment on lines +33 to +36
select_x = [ybus.lookup[1][i] for i in study_buses];
select_y = [ybus.lookup[2][i] for i in study_buses];
unselect_x = [ybus.lookup[1][i] for i in keys(ybus.lookup[1]) if i ∉ study_buses];
unselect_y = [ybus.lookup[2][i] for i in keys(ybus.lookup[1]) if i ∉ study_buses];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
select_x = [ybus.lookup[1][i] for i in study_buses];
select_y = [ybus.lookup[2][i] for i in study_buses];
unselect_x = [ybus.lookup[1][i] for i in keys(ybus.lookup[1]) if i study_buses];
unselect_y = [ybus.lookup[2][i] for i in keys(ybus.lookup[1]) if i study_buses];
select_x = [ybus.lookup[1][i] for i in study_buses]
select_y = [ybus.lookup[2][i] for i in study_buses]
unselect_x = [ybus.lookup[1][i] for i in keys(ybus.lookup[1]) if i study_buses]
unselect_y = [ybus.lookup[2][i] for i in keys(ybus.lookup[1]) if i study_buses]

Comment on lines +38 to +40
Y_se = ybus.data[select_x, unselect_y];
Y_es = ybus.data[unselect_x, select_y];
Y_ee = ybus.data[unselect_x, unselect_y];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
Y_se = ybus.data[select_x, unselect_y];
Y_es = ybus.data[unselect_x, select_y];
Y_ee = ybus.data[unselect_x, unselect_y];
Y_se = ybus.data[select_x, unselect_y]
Y_es = ybus.data[unselect_x, select_y]
Y_ee = ybus.data[unselect_x, unselect_y]

Comment on lines 42 to 43
A = Y_se*KLU.solve!(KLU.klu(Y_ee), Matrix(Y_es));
B = KLU.solve!(KLU.klu(Y_ee), Matrix(transpose(Y_se)));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
A = Y_se*KLU.solve!(KLU.klu(Y_ee), Matrix(Y_es));
B = KLU.solve!(KLU.klu(Y_ee), Matrix(transpose(Y_se)));
A = Y_se * KLU.solve!(KLU.klu(Y_ee), Matrix(Y_es))
B = KLU.solve!(KLU.klu(Y_ee), Matrix(transpose(Y_se)))

return Ward_data(
A,
B,
study_buses
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
study_buses
study_buses,

B,
study_buses
)
end
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
end
end

Copy link
Contributor

github-actions bot commented Dec 5, 2023

Performance Results

Version Precompile Time
Main 1.869578039
This Branch 1.889740657
Version Execute Time
Main-Build PTDF First 3.708752014
Main-Build PTDF Second 0.133474029
Main-Build Ybus First 0.343788725
Main-Build Ybus Second 0.006984718
Main-Build LODF First 0.754000638
Main-Build LODF Second 0.183193474
This Branch-Build PTDF First 3.615746103
This Branch-Build PTDF Second 0.085165693
This Branch-Build Ybus First 0.336960912
This Branch-Build Ybus Second 0.00695866
This Branch-Build LODF First 0.756507305
This Branch-Build LODF Second 0.190960843


end
end
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
end
end

Comment on lines +42 to +43
A = -Y_se*KLU.solve!(KLU.klu(Y_ee), Matrix(Y_es));
B = KLU.solve!(KLU.klu(Y_ee), Matrix(transpose(Y_se)));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
A = -Y_se*KLU.solve!(KLU.klu(Y_ee), Matrix(Y_es));
B = KLU.solve!(KLU.klu(Y_ee), Matrix(transpose(Y_se)));
A = -Y_se * KLU.solve!(KLU.klu(Y_ee), Matrix(Y_es))
B = KLU.solve!(KLU.klu(Y_ee), Matrix(transpose(Y_se)))

hvdc_line = PSY.get_component(PSY.TwoTerminalHVDCLine, sys, "DC1");
study_buses = [
PSY.get_from(PSY.get_arc(hvdc_line)),
PSY.get_to(PSY.get_arc(hvdc_line))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
PSY.get_to(PSY.get_arc(hvdc_line))
PSY.get_to(PSY.get_arc(hvdc_line)),


# ! angles are different after computation


Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant